Goto

Collaborating Authors

 play snake


Writing Snake in 12 Lines of PyTorch

#artificialintelligence

Today we are programming a version of Snake where the snake can loop around the screen. However, you can change 2 lines to produce the original version of Snake, but I will leave that as an exercise for the reader. We will be using PyTorch and NumPy. This could have been done completely in either, but I prefer the PyTorch tensor API and NumPy has a nice function called unravel_index that we will be using. I will also not be counting the imports and function declaration; call it freedom of artistic expression.



Training a Deep Reinforcement Learning Agent to Play Snake

#artificialintelligence

Those of us who have ever used a Nokia mobile phone two decades ago will remember the Snake game that was first introduced on the Nokia 6110. An adaption of an arcade game from 1976, it eventually found itself on 400 million phones. Indeed, there is even a "World Snake Day" for nostalgic fans to remember this bygone era. But can you train a deep reinforcement learning agent to play the game? Data scientist Hennie de Harder decided to find out and chronicled her journey of pitting an agent against a Python version of the game in a blog post on Towards Data Science. One of three basic machine learning paradigms, reinforcement learning is an area of machine learning concerned with software agents that take action based on maximizing predefined rewards.


Neural Network Learns to Play Snake

#artificialintelligence

Sign in to report inappropriate content. In this project I built a neural network and trained it to play Snake using a genetic algorithm. Subscribe if you enjoyed and Share if you know anyone who would be interested!


[P] CNN learning to play snake using RL โ€ข r/MachineLearning

@machinelearnbot

All is open source, though not "published" yet so excuse me if the repository is a bit hard to navigate / unclear. I've been building a Unity-esque 2D engine with pygame, which should be easy to plug in with OpenAI's gym. Goal here isn't to build the most optimal environments per se, but a way to implement games that are human and AI playable. Hopefully I'll get to release a slightly more convenient setup soon, with each (sub)project separated into their own repo:)